package com.zhike.common.utils;

import java.util.concurrent.ConcurrentHashMap;


/**
 * 存储session
 */
public class ServerSessionMap {
    private static ConcurrentHashMap<String, ServerSession> sessionMap = new ConcurrentHashMap<>();

    public static void add(String uid, ServerSession session) {
        sessionMap.put(uid, session);
    }

    public static void removeSession(String uid) {
        sessionMap.remove(uid);
    }

    public static ServerSession getSession(String uid) {
        return sessionMap.get(uid);
    }
}
